#include "dogservice_api.h"
#include "dogservice.h"
#include <string.h>

static DogService dogService;

int dogStart()
{
    return dogService.start();
}

void dogStop()
{
    dogService.stop();
}

int getDogMemoryInfo(char* buf, int bufsize)
{
    std::string memoryInfo = dogService.getMemoryInfo();
    if (memoryInfo.size() > bufsize)
        return -1;
    memcpy(buf, memoryInfo.c_str(), memoryInfo.size());
    return 0;
}

void checkDogExpireDate(void(*cb)(int))
{
    return dogService.checkDogExpireDate(cb);
}

int dogExpireDateStatus()
{
    return dogService.getDogExpireDateStatus();
}

void setDogTimerInterval(int interval, int expDateinterval)
{
    dogService.setTimerInterval(interval, expDateinterval);
}

int dogStatus()
{
    return dogService.getDogStatus();
}

void checkDogStatus(void(*cb)(int))
{
    dogService.checkDogStatus(cb);
}

int dogCheckExpDateFlag()
{
    return dogService.getCheckExpDateFlag();
}

